﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;

namespace Deloitte
{
    public sealed class Generics<T>
    {        
        public static BindingList<T> ToBindingList(List<T> list)
        {
            BindingList<T> bindingList = new BindingList<T>();
            for (int i = 0; i < list.Count; i++)
            {
                bindingList.Add(list[i]);
            }
            return bindingList;
        }
        public static T GetNewObject<T>()
        {
            try
            {
                return (T)typeof(T).GetConstructor(new Type[] { }).Invoke(new object[] { });
            }
            catch
            {
                return default(T);
            }
        }
    }
}